﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using SuperDarts.Gameplay.Modes;
using SuperDarts.Screens.Menus;

namespace SuperDarts.Gameplay.Views
{
    public class BastardView : BaseView
    {
        private readonly Dartboard _dartboard = new Dartboard();

        public BastardView(Bastard mode)
            : base(mode)
        {
            foreach (var p in mode.PlayerSegments)
            {
                _dartboard.ColorSegment(p.Key, p.Value.Color*0.33f);
            }

            _dartboard.Scale = 0.6f;
        }

        public override void LoadContent(ContentManager content)
        {
            base.LoadContent(content);

            _dartboard.LoadContent(content);
        }

        public override void Draw(SpriteBatch spriteBatch)
        {
            base.Draw(spriteBatch);

            _dartboard.Position = new Vector2(SuperDarts.Viewport.Width*0.5f, SuperDarts.Viewport.Height*0.366f);
            _dartboard.Draw(spriteBatch);

            spriteBatch.Begin();
            DrawRoundScores(spriteBatch, new Vector2(20, SuperDarts.Viewport.Height*0.33f));
            spriteBatch.End();
        }
    }
}